
<?php
class waiController extends Controller{

	private $_model;
	public $layout='layout3';
	

	public function actionIndex(){
		$_model = new Links;
		$newsId = (int)NC::_g("id",0);
		if(!$newsId){
			throw new CHttpException('404','找不到该页面');
		}
		$title = NC::_g("title",'');
		$this->pageTitle = $title;
		//新闻内容
		$news = News::model()->findByPk($newsId);
		//用户内容
		$user = User::model()->findByPk($news->user_id);
		$this->render('wai',array('news'=>$news,'user'=>$user));
	}

	/**
	 * This is the action to handle external exceptions.
	 */
	public function actionError()
	{
	    if($error=Yii::app()->errorHandler->error)
	    {
	    	if(Yii::app()->request->isAjaxRequest)
	    		json(false,$error['message']);
	    	else
	        	$this->render('error', $error);
	    }
	}

	
}